home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / Syn Text Editor 2.1.0.46 / synsetup-2.1.0.46.exe / {app} / scripts / htmlencrypt.vbs < prev    next >
Text File  |  2003-08-13  |  3KB  |  72 lines

  1. ' Caption: HTML Encrypt|
  2. ' Hint: HTML Encrypt|
  3. ' Icon: htmlencrypt.ico|
  4. '
  5. '  syn
  6. '  Copyright (C) 2000-2003, Ascher Stefan. All rights reserved.
  7. '  stievie@utanet.at, http://web.utanet.at/ascherst/
  8. '
  9. '  The contents of this file are subject to the Mozilla Public License
  10. '  Version 1.1 (the "License"); you may not use this file except in compliance
  11. '  with the License. You may obtain a copy of the License at
  12. '  http://www.mozilla.org/MPL/
  13. '
  14. '  Software distributed under the License is distributed on an "AS IS" basis,
  15. '  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
  16. '  the specific language governing rights and limitations under the License.
  17. '
  18. '  The Original Code is htmlencrypt.vbs, released Sat, 28 Sep 2002 22:56:45 UTC.
  19. '
  20. '  The Initial Developer of the Original Code is Ascher Stefan.
  21. '  Portions created by Ascher Stefan are Copyright (C) 2000-2003 Ascher Stefan.
  22. '  All Rights Reserved.
  23. '
  24. '  Contributor(s): .
  25. '
  26. '  Alternatively, the contents of this file may be used under the terms of the
  27. '  GNU General Public License Version 2 or later (the "GPL"), in which case
  28. '  the provisions of the GPL are applicable instead of those above.
  29. '  If you wish to allow use of your version of this file only under the terms
  30. '  of the GPL and not to allow others to use your version of this file
  31. '  under the MPL, indicate your decision by deleting the provisions above and
  32. '  replace them with the notice and other provisions required by the GPL.
  33. '  If you do not delete the provisions above, a recipient may use your version
  34. '  of this file under either the MPL or the GPL.
  35. '
  36. '  You may retrieve the latest version of this file at the syn home page,
  37. '  located at http://syn.sourceforge.net/
  38. '
  39. ' $Id: htmlencrypt.vbs,v 1.1.2.5 2003/08/13 00:38:45 neum Exp $
  40. '
  41.  
  42. ' ScriptEngine=VBScript
  43.  
  44. ' This script encrypts any string into Enitites like HTML code. You can use it for
  45. ' e.g. your Email Address when you put it on your web page, and you want to be
  46. ' protected from Spam. But maybe this Spam programs are also able to convert this
  47. ' code back, a browser does it as well.
  48.  
  49. option explicit
  50.  
  51. ' Remove the dot to include this file(s)
  52. '#.include <consts>
  53. '#.include <cmnfunc>
  54.  
  55. sub Main(FileName)
  56.   if Documents.Count = 0 then exit sub
  57.   dim str, def
  58.   if ActiveDocument.SelText = "" then
  59.     def = "$[Email]"
  60.   else
  61.     def = ActiveDocument.SelText
  62.   end if
  63.   str = InputBox("Enter the String to encrypt.", "HTML Encrypt", def)
  64.   if str <> "" then
  65.     dim i, outstr
  66.     for i = 1 to Len(str)
  67.       outstr = outstr & "&#" & CStr(Asc(Mid(str, i, 1))) & ";"
  68.     next
  69.     ActiveDocument.SelText = outstr
  70.   end if
  71. end sub
  72.